﻿
#include <UIlib.h>
#include <clicore.h>
#include "climain.h"
#include "window/CRuisMainFramWnd.h"

#define MAXBUFSIZE 1024*5

using namespace DuiLib;
using namespace cliCore;
using namespace cliMain;

int ruisMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {

    char path_app[ MAXBUFSIZE ];
    CPaintManagerUI::SetInstance(hInstance);
    CPaintManagerUI::SetResourcePath(DuiLib::CPaintManagerUI::GetInstancePath() + _T("skin"));

    sprintf(path_app,CPaintManagerUI::GetInstancePath());
#ifdef DEBUG
    printf("appPath:%s\n",path_app);
    CPaintManagerUI::SetResourcePath(_T("I:\\programs\\ruis\\MingDuilibClient\\Skin"));
#endif
    CPaintManagerUI::SetResourceZip(_T("360SafeRes.zip"));
	HRESULT Hr = ::CoInitialize(NULL);
	if (FAILED(Hr)) return 0;

	CRuisMainFramWnd* pFrame = new CRuisMainFramWnd();
	pFrame->Create(NULL, _T("一点通教学网"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 800, 572);
	pFrame->CenterWindow();
	::ShowWindow(pFrame->GetHWND(), SW_SHOW);

	CPaintManagerUI::MessageLoop();

	delete pFrame;
    ::CoUninitialize();
	return 0;
}

